package cn.leven.web.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * /*表示所有资源
 * /index.jsp 表示指定资源
 */
@WebFilter( "/index.jsp")
public class FilterDemo1 implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        System.out.println("Filter执行");
        chain.doFilter(req, resp); //放行
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
